package edu.hz.pro1_50;

import java.util.Scanner;

/**
 * Created by weishaofei on 2018/3/11.
 */
public class Main1003 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int size = scanner.nextInt();
        int index = 0;
        while (size > 0) {
            int numSize = scanner.nextInt();
            index++;
            int sum = 0;
            int begin = 1;
            int end = 0;
            int seq = 0;
            while (seq < numSize) {
                seq++;
                int num = scanner.nextInt();
                sum = sum + num;
                if (numSize == 1) {
                    printLing(sum, numSize, numSize, index, size);
                }
                if (sum < num) {
                    begin = seq;
                    end = seq;
                } else {
                    end = seq - 1;
                }
            }
            size--;
        }
        System.exit(0);
    }

    private static void printLing(int sum, int begin, int end, int index, int total) {
        System.out.println("Case " + index + ":");
        System.out.println(sum + " " + begin + " " + end);
        if (index != total) {
            System.out.println();
        }
    }

}
